import { Component } from 'react';
import ThemeContext from './themeContext';

// 自定义主题
export default class ThemedButton extends Component {

    static contextType = ThemeContext

    render() {
        let props = this.props;
        let theme = this.context;
        return (
            <button
                {...props}
                style={{ backgroundColor: theme.background, color: theme.foreground}}
            >{props.children}</button>
        )
    }
}
